<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<!--
    window对象中有个属性history  属性值对象
    1. 前进
    2. 后退
-->

<h2>history2</h2>
<button>跳转history3</button>
<button id="forward">前进</button>
<button id="back">后退</button>


<script>

    document.getElementsByTagName('button')[0].onclick = function () {
        window.location.href = './11-history3.html'
    }
    document.getElementById('forward').onclick = function () {
        // 前进
        // window.history.forward()
        window.history.go(1)
    }


    document.getElementById('back').onclick = function () {
        // 后退
        window.history.back()
    }
</script>

</body>
</html>